//
//  PictureCellView.m
//  LStyle
//
//  Created by Obaid Abdul Maroof on 12/19/09.
//  Copyright 2009 Vrije University. All rights reserved.
//

#import "PictureCellView.h"
#define IMAGE_LOCATION @"http://lstyle.com/upload/nightlife/%7BM0K80D-M7MX-9RZY-7DWT3V%7D/%7BM0K80D-M7MX-9RZY-7DWT3V%7D.jpg"

@implementation PictureCellView

- (id)initWithFrame:(CGRect)aRect reuseIdentifier:(NSString *)identifier{
	if (self = [super initWithFrame:aRect reuseIdentifier:identifier])
	{
		// turn off selection use
		self.selectionStyle = UITableViewCellSelectionStyleGray;
		
		CGSize size = aRect.size;
		
		
		UIImage *img = [UIImage imageNamed:@"neyyork.png"];
		imgPictures = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, aRect.size.width - 5, aRect.size.height-40)];
		imgPictures.image = img;
		
		
		lblName = [[UILabel alloc] initWithFrame:CGRectMake(5, aRect.size.height - 30, 100 , 20)];
		
		lblName.text = @"LONDON";
		
		
		lblName.font = [UIFont fontWithName:@"Verdana" size: 14.0];

		[self.contentView addSubview:imgPictures];
		[self.contentView addSubview:lblName];
	}
    
	return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {

    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)layoutSubviews
{
	[super layoutSubviews];
	CGRect rect = [self.contentView bounds];

	CGSize size = rect.size;
	CGSize size2 = size;
	
	rect.origin.x = 5;
	rect.origin.y = 5;
	size.width = (size.width - 10);
	size.height -= 40;
	rect.size = size;
	
	imgPictures.frame = rect;	
	
	rect.origin.y += imgPictures.frame.size.height + 5;
	size.height = 20;
	rect.size = size;	
	
	lblName.frame = rect;
}


- (void)dealloc {
    [super dealloc];
}


@end
